#ifndef JSONDATAMANAGER_H
#define JSONDATAMANAGER_H

#include <QObject>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QList>
#include <QString>
#include <QDebug>

struct spotData{
    int time;
    int pos;
    int mode;
    int end_time;
};
struct songData{
    QString name;
    int duration;
    int rhythmNum;
};

class JsonDataManager : public QObject
{
    Q_OBJECT
public:
    explicit JsonDataManager(QObject *parent = 0);

    Q_INVOKABLE void addSpotData(int time,int pos,int mode,int endTime);
    Q_INVOKABLE void clearSpotData();
    Q_INVOKABLE void setRhythmData(QString name,int duration,int rhythmNum);
    Q_INVOKABLE void comressDataToJson();
    Q_INVOKABLE void saveDatas(QString fileName,QString filePath);

signals:

public slots:

private:
    QList<spotData> spotdata;
    songData songdata;
    QByteArray byteDatas;
};

#endif // JSONDATAMANAGER_H
